package top.riske.animalhazardassessment.common.DTO;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Setter;

@Setter
public class AnalyseDto {

    private Long animalId;

    @Schema(description = "计算得出的风险指数")
    private Double riskPoint;

    @Schema(description = "动物咬合力度指数")
    private Integer occlusion;

    @Schema(description = "动物体格,0-微型，1-小型，2-中型，3-大型")
    private Integer physique;

    @Schema(description = "危险性基因指数，父母是否有过重大伤人行为，0-无，1-父母伤人，2-兄弟姐妹伤人，3-爷爷伤人")
    private Integer gene;

    @Schema(description = "陌生人靠近前是否发出预警信号，0-乖巧，1-胆怯，2-低吼，3-龇牙，4-狂吠，5-扑咬")
    private Integer PreWarn;

    @Schema(description = "护食程度,0-无，1-低吼，2-龇牙，3-扑咬")
    private Integer protectFood;

    @Schema(description = "主人犬只控制技术，能否有效控制犬只行为，100为满分")
    private Integer ownerPoint;

    @Schema(description = "是否已打过疫苗")
    private Boolean vaccines;

    @Schema(description = "被投诉次数")
    private Integer complaint;

    @Schema(description = "环境风险指数，0-无，1-低，2-中，3-高")
    private Integer environment;

    public Double getRiskPoint() {
        if(riskPoint == null){
            return 0.0;
        }
        return riskPoint;
    }

    public Integer getOcclusionRisk() {
        if(occlusion == null){
            return 0;
        }
        return occlusion;
    }

    public Integer getPhysiqueRisk() {
        if(physique == null){
            return 0;
        }
        return physique*25;
    }

    public Integer getGeneRisk() {
        if(gene == null){
            return 0;
        }
        return gene * 33;
    }

    public Integer getPreWarnRisk() {
        if(PreWarn == null){
            return 0;
        }
        return PreWarn * 20;
    }

    public Integer getProtectFoodRisk() {
        if(protectFood == null){
            return 0;
        }
        return protectFood * 33;
    }

    public Integer getOwnerPointRisk() {
        if(ownerPoint == null){
            return 0;
        }
        return 100 - ownerPoint;
    }

    public Integer getVaccinesRisk() {
        if(vaccines == null){
            return 0;
        }

        if(vaccines){
            return 20;
        }
        return 100;

    }

    public Integer getComplaintRisk() {
        if(complaint == null){
            return 0;
        }
        if(complaint > 5){
            return 100;
        }
        return complaint * 20;
    }

    public Integer getEnvironmentRisk() {
        if(environment == null){
            return 0;
        }
        return environment * 33;
    }

    public Long getAnimalId() {
        return animalId;
    }

    public Integer getOcclusion() {
        return occlusion;
    }

    public Integer getPhysique() {
        return physique;
    }

    public Integer getGene() {
        return gene;
    }

    public Integer getPreWarn() {
        return PreWarn;
    }

    public Integer getProtectFood() {
        return protectFood;
    }

    public Integer getOwnerPoint() {
        return ownerPoint;
    }

    public Boolean getVaccines() {
        return vaccines;
    }

    public Integer getComplaint() {
        return complaint;
    }

    public Integer getEnvironment() {
        return environment;
    }

    public AnalyseDto() {
    }
}
